/**
 * Created by chengming on 18/5/27.
 * version 1.0
 */
const BaseJsonAdapter = require('../base/BaseJsonAdapter');
const iconv = require("iconv-lite");
const request = require('request-promise');

/**
 * 北京互金网
 * @type {module.Bjp2p}
 */
module.exports = class SzseQFII extends BaseJsonAdapter{

    async reqJson(){
        let html = await request({
          url: 'http://www.szse.cn/api/report/ShowReport/data?SHOWTYPE=JSON&CATALOGID=1264&loading=first&random=' + Math.random()
        });
        let contents = [];
        if (html) {
          html = JSON.parse(html)
          console.log(html)
          for(let row of html) {
            for(let info of row.data){
              contents.push({
                title: info['jyrq'] + ' ' + info['zqdh'] + ' ' +  info['zqjc'],
                href: 'http://www.szse.cn/disclosure/deal/qfii/index.html'
              });
            }

          }
        }

        return {data:contents}
	  }
}
